<div class="row">
    <div class="col-xs-12">

        <form action="" method="POST" class="form-search">
            <table class="table table-striped table-bordered table-hover">
                <tr>
                    <td class="col-xs-3 col-sm-1">
                        <select id="search_type" name="search_type">
                            <option value="id" {{if eq "id" .search_type}}selected="selected"{{end}}>项目ID</option>
                            <option value="cron_id" {{if eq "cron_id" .search_type}}selected="selected"{{end}}>任务ID</option>
                        </select>
                    </td>

                    <td class="col-xs-3 col-sm-2">
                        <input type="text" name="search_word" value="{{.search_word}}" placeholder="关键词">
                    </td>

                    <td colspan="80">
                        <input type="button" name="search" onclick="go_search('index');" value="查询" class="btn btn-purple btn-sm"/>
                    </td>
                </tr>
            </table>
            <script type="text/javascript">
                function go_search($ac){
                    $('.form-search').attr('action',$ac).submit();
                }
            </script>
        </form>


        <div class="table-responsive">
            <table id="function-table" class="table table-bordered table-hover" style="word-wrap: break-word; word-break: break-all;">
                <thead>
                <tr>
                    <th class="col-sm-1">序号</th>
                    <th class="col-sm-1">任务ID</th>
                    <th class="col-sm-3">返回数据</th>
                    <th class="col-sm-2">错误内容</th>
                    <th class="col-sm-1">执行时间(ms)</th>
                    <th class="col-sm-2">创建时间</th>
                    <th class="col-sm-1">状态</th>
                </tr>
                </thead>


                <tbody>
                    {{range  $k, $v := .list}}
                    <tr>
                        <td>{{$v.Id}}</td>
                        <td>{{$v.CronId}}</td>
                        <td>{{if eq "" $v.Output}}无{{else}}<pre>{{$v.Output}}</pre>{{end}}</td>
                        <td>{{if eq "" $v.Error}}无{{else}}{{$v.Error}}{{end}}</td>
                        <td>{{$v.ProcessTime}}</td>
                        <td>{{$v.CreateTime}}</td>
                        <td>
                            {{if eq 0 $v.Status}}
                                <span title="执行成功" class="badge badge-warning">执行成功</span>
                            {{else}}
                                <span title="执行失败" class="badge">执行失败</span>
                            {{end}}
                        </td>
                    </tr>
                    {{end}}
                </tbody>
            </table>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-xs-12">
        <div class="dataTables_paginate paging_bootstrap">{{str2html .pageLink}}</div>
    </div>
</div>

<script>
jQuery(function($) {
});
</script>
